Ext.namespace("Maint.Show65");

Maint.Show65.showInfo = function (){
	/* basic info */
    this.txtWoNum = new Ext.form.TextField({fieldLabel: '工单流水号',readOnly: true,width: 160 });
    this.txtWoType = new Ext.form.TextField({fieldLabel: '工单子类型',readOnly: true,width: 160 });
    this.txtCreateBy = new Ext.form.TextField({fieldLabel: '派单人',readOnly: true,width: 160 });
    this.txtContact= new Ext.form.TextField({fieldLabel: '联系方式',readOnly: true,width: 160 });
    this.txtCreateDep = new Ext.form.TextField({fieldLabel: '部门名称',readOnly: true,width: 160 });
    this.txtCreateTime = new Ext.form.DateField({fieldLabel: '派单时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtTopic = new Ext.form.TextArea({fieldLabel: '工单主题',readOnly: true,width: 460,height: 40 });
    /* expand info */
    this.txtOldWoNum = new Ext.form.TextField({fieldLabel: '原工单号',readOnly: true,width: 160 });
    this.txtCsWoNum = new Ext.form.TextField({fieldLabel: '客服工单流水号',readOnly: true,width: 160 });
    this.txtComplainUser = new Ext.form.TextField({fieldLabel: '投诉用户姓名',readOnly: true,width: 160 });
    this.txtComplainTele = new Ext.form.TextField({fieldLabel: '投诉用户电话',readOnly: true,width: 160 });
    this.txtComplainCon = new Ext.form.TextArea({fieldLabel: '投诉内容',readOnly: true,width: 460,height: 50 });
    this.txtReply = new Ext.form.TextArea({fieldLabel: '第一阶段回复处理结果',readOnly: true,width: 460,height: 40 });
    this.txtDescribe = new Ext.form.TextArea({fieldLabel: '描述',readOnly: true,width: 460,height: 40 });
    this.txtNote= new Ext.form.TextField({fieldLabel: '备注',readOnly: true,width: 460 });
    this.txtPigeonholeNotion = new Ext.form.TextField({fieldLabel: '归档意见',readOnly: true,width: 460 });
    this.txtPigeonholeTime = new Ext.form.DateField({fieldLabel: '归档时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
        
	this.colseButton = new Ext.Button({
		text:"关闭",
		handler:function(){
			this.hide();
		},
		scope:this
	});

	this.basicPanel = new Ext.form.FormPanel({
		title:'工单基本信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtWoNum]},
			       {layout: 'form',items: [this.txtWoType]},
			       {layout: 'form',items: [this.txtCreateBy]},
			       {layout: 'form',items: [this.txtContact]},
			       {layout: 'form',items: [this.txtCreateDep]},
			       {layout: 'form',items: [this.txtCreateTime]},
			       {colspan: 2,layout:'form',items: [this.txtTopic]}
		]
	});
	
	this.expandPanel = new Ext.form.FormPanel({
		title:'工单扩展信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtOldWoNum]},
			       {layout: 'form',items: [this.txtCsWoNum]},
			       {layout: 'form',items: [this.txtComplainUser]},
			       {layout: 'form',items: [this.txtComplainTele]},
			       {colspan: 2,layout: 'form',items: [this.txtComplainCon]},
			       {colspan: 2,layout: 'form',items: [this.txtReply ]},
			       {colspan: 2,layout: 'form',items: [this.txtDescribe ]},
			       {colspan: 2,layout: 'form',items: [this.txtNote]},
			       {colspan: 2,layout: 'form',items: [this.txtPigeonholeNotion]},
			       {layout: 'form',items: [this.txtPigeonholeTime ]}
		
		]
	});  
	  
	this.mainPanel= new Ext.Panel({
		//height: bodyHeight-70,
		autoScroll: true,
		items: [this.basicPanel, this.expandPanel]
	}); 
	
	Maint.Show65.showInfo.superclass.constructor.call(this,{
		width:680,
		modal:true,
		autoScroll:false,
		closeAction:'hide',
		buttonAlign:'right',
		buttons:[this.colseButton],
		items:[this.mainPanel],
		listeners:{
		}
	});
	
};


Ext.extend(Maint.Show65.showInfo, Ext.Window, {
	initDetail:function(data){
		this.maintId = data.MAINT_ID;
	    this.txtWoNum.setValue(data.WO_NUM);
	    this.txtWoType.setValue(data.WO_TYPE);
	    this.txtCreateBy.setValue(data.CREATE_BY);
	    this.txtContact.setValue(data.CONTACT);
	    this.txtCreateDep.setValue(data.CREATE_DEP);
	    this.txtCreateTime.setValue(data.CREATE_TIME);
	    this.txtTopic.setValue(data.TOPIC);
	    this.txtOldWoNum.setValue(data.OLD_WO_NUM);    
	    this.txtCsWoNum.setValue(data.CS_WO_NUM);
	    this.txtComplainUser.setValue(data.COMPLAIN_USER);
	    this.txtComplainTele.setValue(data.COMPLAIN_TELE);
	    this.txtComplainCon.setValue(data.COMPLAIN_CON);
	    this.txtReply.setValue(data.REPLY);
	    this.txtDescribe.setValue(data.DESCRIBE);
	    this.txtNote.setValue(data.NOTE);
	    this.txtPigeonholeTime.setValue(data.PIGEONHOLE_TIME);
	    this.txtPigeonholeNotion.setValue(data.PIGEONHOLE_NOTION);
	}
});